﻿@model EmailControllerModel.Index
<div class="page">
    <div class="pageHeader">
        <form id="pagerForm" onsubmit="return navTabSearch(this);" action="/Email" method="post">
        <div class="searchBar">
            <ul class="searchContent">
                <li>
                    <label>
                        显示名称：</label>
                    <input name="Name" type="text" maxlength="16" value="@ViewBag.Name" />
                </li>
            </ul>
            <div class="subBar">
                <ul>
                    <li>
                        <div class="buttonActive">
                            <div class="buttonContent">
                                <button type="submit">
                                    检索</button>
                            </div>
                        </div>
                    </li>
                </ul>
            </div>
        </div>
        </form>
    </div>
    <div class="PageContent">
        <div class="panelBar">
            <ul class="toolBar">
                <li><a class="edit" href="/Email/Account" target="dialog" title="添加E-Mail服务帐号" width="550"
                    height="400" mask="true" onclick="javascript:void(0);"><span>添 加</span></a></li>
                <li><a class="edit" href="/Email/Account/{param}" target="dialog" title="编辑E-Mail服务帐号"
                    width="550" height="400" mask="true" onclick="javascript:void(0);"><span>编 辑</span></a></li>
                <li><a class="delete" href="/Email/DeleteAccount/{param}" target="ajaxTodo" title="确定要删除吗?">
                    <span>删 除</span></a></li>
            </ul>
        </div>
        <table class="table" layouth="138" width="100%">
            <thead>
                <tr>
                    <th width="40" align="center">
                        Id
                    </th>
                    <th>
                        分 类
                    </th>
                    <th width="120">
                        显示名称
                    </th>
                    <th width="200">
                        邮箱帐号
                    </th>
                    <th>
                        SMTP主机
                    </th>
                    <th>
                        SMTP端口
                    </th>
                    <th>
                        用户名
                    </th>
                    <th>
                        密码
                    </th>
                    <th>
                        EnableSsl
                    </th>
                    <th>
                        UseDefaultCredentials
                    </th>
                    <th>
                        状态
                    </th>
                </tr>
            </thead>
            <tbody>
                @foreach (var o in Model.EmailAccounts)
                {
                    <tr target="param" rel="@o.Id">
                        <td>@o.Id
                        </td>
                        <td>@(EmailAccount.CategoryDictionary.FirstOrDefault(x=>x.Key==o.Category).Value)
                        </td>
                        <td>@o.DisplayName
                        </td>
                        <td>@o.Email
                        </td>
                        <td>@o.Host
                        </td>
                        <td>@o.Port
                        </td>
                        <td>@o.Username
                        </td>
                        <td>@o.Password
                        </td>
                        <td>@o.EnableSsl
                        </td>
                        <td>@o.UseDefaultCredentials
                        </td>
                        <td>@o.Status.ToText("可用", "不可用")
                        </td>
                    </tr>
                }
            </tbody>
        </table>
    </div>
</div>
